package tedu.api.io;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

public class OOSDemo {
    public static void main(String[] args) throws IOException {
        Student zs = new Student();
        zs.setName("张三");
        zs.setAge(18);
        zs.setGender("男");
        zs.setOtherInfo(new String[]{"法外狂徒","罗老师","法外张三"});
        System.out.println(zs);


        FileOutputStream fos = new FileOutputStream("Student.txt");
        ObjectOutputStream oos = new ObjectOutputStream(fos);
        oos.writeObject(zs);
        System.out.println("写出");

    }
}
